<?php
	echo '<div class="page_title"><h1>'.$title.'</h1></div><br />';
	
	// Get news
	//$news_query = $this->MNews->getAllNews();
	
	if ( count($news_query) > 0 )
	{
		echo '<div class="box-news">';
		echo '<div class="post_title">News</div>';
		foreach ( $news_query as $key => $news )
		{
			echo '<div class="post_description">';
			echo anchor("newsandevents/news/".$news['path'],$news['title']);
			echo '<p>'.$news['longdesc'].'</p>';
			echo '</div>';
		}
		echo '</div>';
	}
	
	// Get events
	//$events_query = $this->MEvent->getAllEvents();
	
	if ( count($events_query) > 0 )
	{
		echo '<div class="box-events">';
		echo '<div class="post_title">Events</div>';
		foreach ( $events_query as $key => $events )
		{
			echo '<div class="post_description">';
			echo anchor("newsandevents/events/".$events['path'],$events['title']);
			echo '<p>'.$events['longdesc'].'</p>';
			echo '</div>';
		}
		echo '</div>';
	}
	
	// Student Results
	if ( count($student_results) > 0 )
	{
		echo '<div class="post_title" style="margin-top:20px;"> Student Results </div>';
		
		$limit_student_result = 1;
		foreach ( $student_results as $key => $studresult )
		{
			if ( $limit_student_result <= 6 )
			{
				$year = $studresult['year'];
				$group = $studresult['group'];
				$semester = $studresult['semester'];
				
				echo '<div style="width:210px;float:left;margin-right:20px;margin-bottom:10px;">';
					$image_src = base_url().'images/studresult/'.$studresult['result_src'];
					echo '<img title="view image" class="img-popup" style="width:210px;cursor:pointer;max-width:210px;height:auto;border:2px solid #FFFFFF;box-shadow:0 0 3px rgba(0, 0, 0, 0.5);" src="'.$image_src.'" />';
					echo '<p style="text-align:center;margin-top:2px;">Year '.$year.' - Group '.$group.' - Semester '.$semester.'</p>';
				echo '</div>';
			}
			$limit_student_result += 1;
		}
		
		echo anchor("page/details/student-result/","<button class='btn' type='button' style='background:#291670;color:white;'>More Student Result here...</button>",array('onclick'=>'showurl('.base_url().')'));
	}
	
	// Student Schedule
	if ( count($student_schedules) > 0 )
	{
		echo '<div class="post_title" style="margin-top:20px;"> Student Schedules </div>';
		
		$limit_student_schedule = 1;
		foreach ( $student_schedules as $key => $student_schedule )
		{
			if ( $limit_student_schedule <= 6 )
			{
				$year = $student_schedule['year'];
				$group = $student_schedule['group'];
				$semester = $student_schedule['semester'];
				
				echo '<div style="width:210px;float:left;margin-right:20px;margin-bottom:10px;">';
					$image_src = base_url().'images/studentschedule/'.$student_schedule['schedule_src'];
					echo '<img title="view image" class="img-popup" style="width:210px;cursor:pointer;max-width:210px;height:auto;border:2px solid #FFFFFF;box-shadow:0 0 3px rgba(0, 0, 0, 0.5);" src="'.$image_src.'" />';
					echo '<p style="text-align:center;margin-top:2px;">Year '.$year.' - Group '.$group.' - Semester '.$semester.'</p>';
				echo '</div>';
			}
			$limit_student_schedule += 1;
		}
		
		echo anchor("page/details/student-schedule/","<button class='btn' type='button' style='background:#291670;color:white;'>More Student Schedule here...</button>",array('onclick'=>'showurl('.base_url().')'));
	}
?>